/*
 * @Author: MarioGo
 * @Date: 2021-11-12 10:11:08
 * @LastEditTime: 2021-11-20 14:11:33
 * @LastEditors: MarioGo
 * @Description: 文件描述
 * @FilePath: /zheye/src/api/index.ts
 * 可以输入预定的版权声明、个性签名、空行等
 */
import service from './service';

interface singUpProps {
  email: string;
  username: string;
  password: string;
  createdAt?: string;
}

export interface ResultPromiseProps {
  code?: number;
  msg?: string;
  results?: [];
  success?: boolean;
  data?: string;
  errcode?: number;
  errmsg?: string;
}

interface singInProps {
  email: string;
  password: string;
}
//登录 注册  注销
const sign = {
  signUp(params: singUpProps) {
    return service.post('/signup', params);
  },
  signIn(params: singInProps) {
    return service.post('/signin', params);
  },
  signOut() {
    return service.get('/signout');
  },
  signOut2() {
    return service.get('/signout2q');
  },
};

const column = {
  getList() {
    return service.get('/columnlist');
  },
};

export { sign as signAPI, column as columnAPI };
